<?php

namespace app\admin\controller;

use app\common\controller\BasicAdmin;
use app\common\model\CourseCateModel;
use app\common\model\CourseStateModel;

class CourseState extends BasicAdmin
{
    /**
     * 社团文化管理
     */
    protected $model = 'CourseStateModel';

    public function index(){
        $this->title = '教学风采管理';
        return  $this->_query($this->model)
            ->equal('school_id,course_id')
            ->with(['school','course'])
            ->page();

        $str = 'http://zhuotengedu.oss-cn-shenzhen.aliyuncs.com/e3af1a39ea36097a/7989d2965e3ef327.jpg,http://zhuotengedu.oss-cn-shenzhen.aliyuncs.com/05a802eccf7b1e50/f307f838224a267a.jpg';
        dump(explode(",", $str));
    }

    /**
     * 添加
     */
    public function add()
    {
        $this->title = '添加';
        return $this->_form($this->model, 'form');
    }

    /**
     * 编辑
     */
    public function edit()
    {
        $this->title = '编辑';
        return $this->_form($this->model, 'form','',[],['process'=>1]);
    }

    /**
     * 删除
     */
    public function del()
    {
        $this->_delete($this->model);
    }

    public function process(){
        return $this->_form($this->model, 'form');
    }
}